home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
ansippv2
/
pp.man
< prev
next >
Wrap
Text File
|
1988-09-11
|
5KB
|
129 lines
PP (1) PP (1)
NAME
PP - Standalone ANSI-conforming C language preprocessor Version 2
SYNOPSIS
pp [ option ] [ file ] ...
DESCRIPTION
pp copies the input [ files ] (standard input default) to standard
output, expanding C language macros and executing C language
preprocessor directives as specified in the Draft Proposed ANSI
Standard for the C Language.
It is beneficial to refer to the input file by name, rather than
redirecting standard input, so that diagnostics can include the file
name.
The following options are recognized.
-d or -D Define the following (empty) macro.
-c or -C Include comments in output.
-l or -L Include #line directives in output.
-p or -P Include #pragma directives in output.
-m or -M Replace macros in #pragma directives.
The preprocessed output may be used as input to most C compilers.
If the -l option is used, #line directives are included in the output,
so that diagnostics produced by the C compiler will refer to the
original source file, or to the source file indicated in input #line
directives.
If the -p option is used, #pragma directives encountered are copied to
the output. The -m option is required if the C compiler normally
replaces macros in #pragma directives.
EXAMPLES
The following command displays the source file PPMACRO.C on standard
output, after performing all preprocessing directives and replacing
all macros. The output does not include #line or #pragma directives.
Comments are discarded.
pp ppmacro.c
The following command displays the preprocessed source file PPTOK.C on
standard output. #line directives are included, but contain no
filename, since the source file was redirected to standard input,
rather than named as a parameter to PP.EXE. Comments are discarded.
pp <pptok.c -l
The following command deposits the preprocessed source file PPCHAR.C
in the file PPCHAR.PP. #line directives are included, and name the
source file PPCHAR.C, or the files named by #include directives.
#pragma directives are included in the output, and macros within
#pragma directives are replaced. Comments are discarded.
pp -lpm ppchar.c >ppchar.pp
SEE ALSO
Steven Bruce Williams
"Using Tomorrow's C Standard Today"
Computer Language Magazine
Volume 5, Number 7
July 1988
Draft Proposed American National Standard for Information Systems --
Programming Language C - X3 Secretariat: Computer and Business
Equipment Manufacturers Association - Available from Global
Engineering Documents, Inc. 800-854-7179
DIAGNOSTICS
# must be followed by macro parameter.
## may not be first or last.
"defined" may not be defined as a macro.
#elif without #if.
#else without #if.
#endif without #if.
Empty macro argument may not follow ##.
Empty macro argument may not precede ##.
End of input in constant expression.
End of input in macro arguments.
#if directives nested too deeply.
"#include" files nested too deeply.
Internal error.
Invalid "#define" directive.
Invalid "#undef" directive.
Invalid #ifdef directive.
Invalid argument to "defined".
Invalid constant expression.
Invalid parameter list in "#define".
Invalid redefinition of macro.
Invalid token follows ##.
Invalid token precedes ##.
Missing ')' in argument to "defined" operator.
Missing ')' in constant expression.
Missing ':' in conditional expression.
Predefined macros may not be "#undef"ined.
Predefined macros may not be redefined.
Preprocessor directive "#error".
Too few macro arguments.
Too many macro arguments.
Unable to find "#include" file.
Unable to open "#include" file.
Unrecognized "#include" directive.
Unrecognized "#line" directive.
Unrecognized constant expression.
Unrecognized preprocessor directive.
Unrecognized token.
BUGS
An invalid token is diagnosed upon encountering just two periods:
"..". Two periods should be taken as two consecutive "dot" tokens.
This bug notwithstanding, an ellipsis "...", a dot ".", and certain
float constants followed by a dot "1.." are handled correctly.
Token pasting is quite limited. The left token must be an identifier.
The right token must be either an identifier or an integer. The
result is always an identifier. Although this probably permits the
most common usage, there are certainly others that are valid.